package scjp.preparation.exam;

import java.util.concurrent.atomic.AtomicInteger;

class BaseClass {
	private void foo() {
		System.out.println("In BaseClass.foo()");
	}

	void bar() {
		System.out.println("In BaseClass.bar()");
	}

	public static void main(String[] args) {
		DerivedClass po = new DerivedClass();
		po.foo(); // BASE_FOO_CALL
		po.bar();
		String str = "A.B.C!";
		System.out.println(str.replace(".", "?"));
		AtomicInteger i = new AtomicInteger(1);
		increment(i);
		System.out.println(i);
		if(null instanceof Object)
			System.out.println("null is instance of Object");
		if(null instanceof AtomicInteger)
			System.out.println("null is instance of AtomicInteger");
	}
	
	static void increment(AtomicInteger atomicInt){
		atomicInt.incrementAndGet();
		}
}

class DerivedClass extends BaseClass {
	void foo() {
		System.out.println("In Derived.foo()");
	}

	void bar() {
		System.out.println("In Derived.bar()");
	}
}
